﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Devtm.Contracts.Configurations
{


    public enum ContextEnum
    {        
        Key,
        SectionType
    }

    public partial class ConfigurationResolver
    {

        string[] _context = new string[0];
        public string[] GetContext()
        {

            if (_context.Length == 0)
            {

                List<String> l = new List<string>();

                if (!string.IsNullOrEmpty(Configuration.Environment))
                    l.Add(string.Format("Environment={0}", Configuration.Environment));

                foreach (ConfigurationContextItem item in Configuration.Contexts)	            
                    l.Add(string.Format("{0}={1}", item.Type.ToString(), item.Name));
                
                _context = l.ToArray();
            }

            return _context;
        }

    }
}
